package practice;

import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.*;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/12
 * @VERSION 1.0
 * @DESC
 * 安全集合和阻塞队列(在线程池中)
 */
public class CollectionAndQueue {
    public static void main(String[] args) {
        //List
        List<Integer> list = new CopyOnWriteArrayList<>();//删除，添加时加锁
        Set<Integer> set = new CopyOnWriteArraySet<>();
        Map<String,String> map = new ConcurrentHashMap<>();//分段锁:上线人数（websocket中）

        DelayQueue<Delayed> queue = new DelayQueue<Delayed>();

    }
}
